<?php

/*
 * Edit by xinli
 * Click nbfs://nbhost/SystemFileSystem/Templates/Scripting/PHPClass.php to edit this template
 */

namespace api\mall\model;

/**
 * Description of NotificationModel
 *
 * @author PC
 */
class NotificationModel extends \think\Model
{
    protected $name = 'notification';

    /**
     * 后台管理添加页面
     * @param array $data 页面数据
     * @return $this
     */
    public function adminAddNotification($data)
    {
        $this->save($data);

        return $this;

    }

    /**
     * detail 自动转化
     * @param $value
     * @return string
     */
    public function getDetailAttr($value)
    {
        if (empty($value)) {
            return '';
        }
        return cmf_replace_content_file_url(htmlspecialchars_decode($value));
    }

    /**
     * detail 自动转化
     * @param $value
     * @return string
     */
    public function setDetailAttr($value)
    {
        if (empty($value)) {
            return '';
        }
        return htmlspecialchars(cmf_replace_content_file_url(htmlspecialchars_decode($value), true));
    }

}
